package com.baidu.mapapi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.WindowManager;
import java.util.List;

public abstract class MapActivity extends Activity
{
  private MapView a = null;

  boolean a(MapView paramMapView)
  {
    if (this.a != null)
      throw new RuntimeException("A mapview has been created!!");
    this.a = paramMapView;
    Mj.d = paramMapView;
    return true;
  }

  public boolean initMapActivity(BMapManager paramBMapManager)
  {
    int i;
    if (paramBMapManager == null)
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        if (this.a == null)
          throw new RuntimeException("A mapview has not been created!!");
        Mj.f = this;
        if (Mj.InitMapControlCC(20, 40) != 1)
          break;
        this.a.a();
        i = 1;
      }
      i = 0;
    }
  }

  protected boolean isLocationDisplayed()
  {
    boolean bool;
    if (this.a != null)
      bool = this.a.b.b();
    while (true)
    {
      return bool;
      bool = false;
    }
  }

  protected abstract boolean isRouteDisplayed();

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Display localDisplay = getWindowManager().getDefaultDisplay();
    Mj.g = localDisplay.getWidth();
    Mj.h = localDisplay.getHeight();
  }

  protected void onDestroy()
  {
    if (this.a != null)
    {
      for (int i = this.a.getOverlays().size() - 1; i >= 0; --i)
      {
        Overlay localOverlay = (Overlay)this.a.getOverlays().get(i);
        if (localOverlay instanceof MyLocationOverlay)
        {
          MyLocationOverlay localMyLocationOverlay = (MyLocationOverlay)localOverlay;
          localMyLocationOverlay.disableMyLocation();
          localMyLocationOverlay.disableCompass();
        }
      }
      this.a.getOverlays().clear();
    }
    this.a = null;
    super.onDestroy();
  }

  public void onNewIntent(Intent paramIntent)
  {
    super.onNewIntent(paramIntent);
  }

  protected void onPause()
  {
    super.onPause();
  }

  protected void onResume()
  {
    super.onResume();
  }
}